# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gtkmm3

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=3.12.0
pkgrel=1
pkgdesc="C++ bindings for gtk3 (mingw-w64)"
arch=('any')
url="http://gtkmm.org"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-atkmm" "${MINGW_PACKAGE_PREFIX}-pangomm" "${MINGW_PACKAGE_PREFIX}-gtk3")
options=('staticlibs' 'strip')
source=("http://ftp.gnome.org/pub/GNOME/sources/gtkmm/${pkgver%.*}/gtkmm-$pkgver.tar.xz")
sha256sums=('86c526ceec15d889996822128d566748bb36f70cf5a2c270530dfc546a2574e1')

build() {
  CPPFLAGS+=" -D_REENTRANT"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../gtkmm-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static \
    --disable-documentation
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
  find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
}
